home *** CD-ROM | disk | FTP | other *** search
/ JCSM Shareware Collection 1996 September / JCSM Shareware Collection (JCS Distribution) (September 1996).ISO / prgtools / czlis110.zip / DEMO.FRM < prev    next >
Text File  |  1994-10-29  |  25KB  |  842 lines

  1. Version 1.00
  2. BEGIN Form frmCzList
  3.     AutoRedraw   = -1
  4.     BackColor    = QBColor(7)
  5.     BorderStyle  = 0
  6.     Caption      = "CzList Demo"
  7.     ControlBox   = -1
  8.     Enabled      = -1
  9.     ForeColor    = QBColor(0)
  10.     Height       = Char(23)
  11.     Left         = Char(0)
  12.     MaxButton    = -1
  13.     MinButton    = -1
  14.     MousePointer = 0
  15.     Tag          = ""
  16.     Top          = Char(1)
  17.     Visible      = -1
  18.     Width        = Char(80)
  19.     WindowState  = 0
  20.     BEGIN Custom CzList
  21.         Action       = 0
  22.         Alignment    = 0
  23.         Archive      = 0
  24.         AutoRedraw   = 0
  25.         BackColor    = QBColor(7)
  26.         BorderStyle  = 1
  27.         Caption      = ""
  28.         Checked      = 0
  29.         Column       = 0
  30.         DragMode     = 0
  31.         Drive        = ""
  32.         Enabled      = -1
  33.         Filename     = ""
  34.         ForeColor    = QBColor(0)
  35.         Height       = Char(8)
  36.         Hidden       = 0
  37.         Interval     = 0
  38.         LargeChange  = 0
  39.         Left         = Char(0)
  40.         ListCount    = 0
  41.         ListIndex    = 0
  42.         Max          = 0
  43.         Min          = 0
  44.         Mode         = 0
  45.         MousePointer = 0
  46.         MultiLine    = 0
  47.         Normal       = 0
  48.         Path         = ""
  49.         Pattern      = ""
  50.         ReadOnly     = -1
  51.         Row          = 0
  52.         ScrollBars   = 0
  53.         SelLength    = 0
  54.         SelStart     = 0
  55.         SelText      = ""
  56.         SmallChange  = 0
  57.         Sorted       = 0
  58.         Style        = 0
  59.         System       = 0
  60.         TabIndex     = 0
  61.         TabStop      = -1
  62.         Tag          = ""
  63.         Text         = ""
  64.         Top          = Char(2)
  65.         TypeID       = "CzList"
  66.         Value        = 0
  67.         Visible      = -1
  68.         Width        = Char(80)
  69.     END
  70.     BEGIN Label Label10
  71.         Alignment    = 0
  72.         AutoSize     = 0
  73.         BackColor    = QBColor(7)
  74.         BorderStyle  = 0
  75.         Caption      = "With the mouse: Click on the top or bottom box line to scroll as well."
  76.         DragMode     = 0
  77.         Enabled      = -1
  78.         ForeColor    = QBColor(15)
  79.         Height       = Char(1)
  80.         Left         = Char(5)
  81.         MousePointer = 0
  82.         TabIndex     = 17
  83.         Tag          = ""
  84.         Top          = Char(1)
  85.         Visible      = -1
  86.         Width        = Char(70)
  87.     END
  88.     BEGIN Frame Frame2
  89.         BackColor    = QBColor(7)
  90.         Caption      = "Tagging:"
  91.         DragMode     = 0
  92.         Enabled      = -1
  93.         ForeColor    = QBColor(0)
  94.         Height       = Char(6)
  95.         Left         = Char(6)
  96.         MousePointer = 0
  97.         TabIndex     = 8
  98.         Tag          = ""
  99.         Top          = Char(10)
  100.         Visible      = -1
  101.         Width        = Char(68)
  102.         BEGIN Label Label8
  103.             Alignment    = 0
  104.             AutoSize     = 0
  105.             BackColor    = QBColor(7)
  106.             BorderStyle  = 0
  107.             Caption      = "Keyboard: SPACE to tag/untag"
  108.             DragMode     = 0
  109.             Enabled      = -1
  110.             ForeColor    = QBColor(15)
  111.             Height       = Char(1)
  112.             Left         = Char(1)
  113.             MousePointer = 0
  114.             TabIndex     = 14
  115.             Tag          = ""
  116.             Top          = Char(3)
  117.             Visible      = -1
  118.             Width        = Char(30)
  119.         END
  120.         BEGIN Label Label9
  121.             Alignment    = 0
  122.             AutoSize     = 0
  123.             BackColor    = QBColor(7)
  124.             BorderStyle  = 0
  125.             Caption      = "Mouse: RIGHT button to tag/untag"
  126.             DragMode     = 0
  127.             Enabled      = -1
  128.             ForeColor    = QBColor(15)
  129.             Height       = Char(1)
  130.             Left         = Char(33)
  131.             MousePointer = 0
  132.             TabIndex     = 15
  133.             Tag          = ""
  134.             Top          = Char(3)
  135.             Visible      = -1
  136.             Width        = Char(32)
  137.         END
  138.         BEGIN CommandButton cmdTag
  139.             BackColor    = QBColor(7)
  140.             Cancel       = 0
  141.             Caption      = "&Tag All Items"
  142.             Default      = 0
  143.             DragMode     = 0
  144.             Enabled      = -1
  145.             Height       = Char(1)
  146.             Left         = Char(33)
  147.             MousePointer = 0
  148.             TabIndex     = 18
  149.             TabStop      = -1
  150.             Tag          = ""
  151.             Top          = Char(1)
  152.             Visible      = -1
  153.             Width        = Char(19)
  154.         END
  155.         BEGIN CommandButton cmdUntag
  156.             BackColor    = QBColor(7)
  157.             Cancel       = 0
  158.             Caption      = "&Untag All Items"
  159.             Default      = 0
  160.             DragMode     = 0
  161.             Enabled      = -1
  162.             Height       = Char(1)
  163.             Left         = Char(33)
  164.             MousePointer = 0
  165.             TabIndex     = 19
  166.             TabStop      = -1
  167.             Tag          = ""
  168.             Top          = Char(2)
  169.             Visible      = -1
  170.             Width        = Char(19)
  171.         END
  172.         BEGIN CheckBox chkKeybTag
  173.             BackColor    = QBColor(7)
  174.             Caption      = "&Keyboard Tag-Scrolling"
  175.             DragMode     = 0
  176.             Enabled      = -1
  177.             ForeColor    = QBColor(0)
  178.             Height       = Char(1)
  179.             Left         = Char(1)
  180.             MousePointer = 0
  181.             TabIndex     = 10
  182.             TabStop      = -1
  183.             Tag          = ""
  184.             Top          = Char(1)
  185.             Value        = 0
  186.             Visible      = -1
  187.             Width        = Char(26)
  188.         END
  189.         BEGIN CheckBox chkMouseTag
  190.             BackColor    = QBColor(7)
  191.             Caption      = "&Mouse Tag-Scrolling"
  192.             DragMode     = 0
  193.             Enabled      = -1
  194.             ForeColor    = QBColor(0)
  195.             Height       = Char(1)
  196.             Left         = Char(1)
  197.             MousePointer = 0
  198.             TabIndex     = 11
  199.             TabStop      = -1
  200.             Tag          = ""
  201.             Top          = Char(2)
  202.             Value        = 0
  203.             Visible      = -1
  204.             Width        = Char(26)
  205.         END
  206.         BEGIN Label lblItemsTagged
  207.             Alignment    = 0
  208.             AutoSize     = 0
  209.             BackColor    = QBColor(7)
  210.             BorderStyle  = 0
  211.             Caption      = "Label6"
  212.             DragMode     = 0
  213.             Enabled      = -1
  214.             ForeColor    = QBColor(0)
  215.             Height       = Char(1)
  216.             Left         = Char(47)
  217.             MousePointer = 0
  218.             TabIndex     = 13
  219.             Tag          = ""
  220.             Top          = Char(0)
  221.             Visible      = -1
  222.             Width        = Char(7)
  223.         END
  224.         BEGIN CheckBox chkAllowTag
  225.             BackColor    = QBColor(7)
  226.             Caption      = "&Allow Tagging"
  227.             DragMode     = 0
  228.             Enabled      = -1
  229.             ForeColor    = QBColor(0)
  230.             Height       = Char(1)
  231.             Left         = Char(1)
  232.             MousePointer = 0
  233.             TabIndex     = 9
  234.             TabStop      = -1
  235.             Tag          = ""
  236.             Top          = Char(0)
  237.             Value        = 0
  238.             Visible      = -1
  239.             Width        = Char(22)
  240.         END
  241.         BEGIN Label Label5
  242.             Alignment    = 0
  243.             AutoSize     = 0
  244.             BackColor    = QBColor(7)
  245.             BorderStyle  = 0
  246.             Caption      = "Items Tagged ="
  247.             DragMode     = 0
  248.             Enabled      = -1
  249.             ForeColor    = QBColor(0)
  250.             Height       = Char(1)
  251.             Index        = 1
  252.             Left         = Char(33)
  253.             MousePointer = 0
  254.             TabIndex     = 12
  255.             Tag          = ""
  256.             Top          = Char(0)
  257.             Visible      = -1
  258.             Width        = Char(14)
  259.         END
  260.     END
  261.     BEGIN CommandButton cmdCzDir
  262.         BackColor    = QBColor(7)
  263.         Cancel       = 0
  264.         Caption      = "Cz&Dir"
  265.         Default      = 0
  266.         DragMode     = 0
  267.         Enabled      = -1
  268.         Height       = Char(3)
  269.         Left         = Char(64)
  270.         MousePointer = 0
  271.         TabIndex     = 20
  272.         TabStop      = -1
  273.         Tag          = ""
  274.         Top          = Char(16)
  275.         Visible      = -1
  276.         Width        = Char(10)
  277.     END
  278.     BEGIN CommandButton cmdCancel
  279.         BackColor    = QBColor(7)
  280.         Cancel       = -1
  281.         Caption      = "&Cancel"
  282.         Default      = 0
  283.         DragMode     = 0
  284.         Enabled      = -1
  285.         Height       = Char(3)
  286.         Left         = Char(64)
  287.         MousePointer = 0
  288.         TabIndex     = 1
  289.         TabStop      = -1
  290.         Tag          = ""
  291.         Top          = Char(19)
  292.         Visible      = -1
  293.         Width        = Char(10)
  294.     END
  295.     BEGIN Frame Frame1
  296.         BackColor    = QBColor(7)
  297.         Caption      = "General Information:"
  298.         DragMode     = 0
  299.         Enabled      = -1
  300.         ForeColor    = QBColor(0)
  301.         Height       = Char(6)
  302.         Left         = Char(6)
  303.         MousePointer = 0
  304.         TabIndex     = 2
  305.         Tag          = ""
  306.         Top          = Char(16)
  307.         Visible      = -1
  308.         Width        = Char(57)
  309.         BEGIN Label Label5
  310.             Alignment    = 0
  311.             AutoSize     = 0
  312.             BackColor    = QBColor(7)
  313.             BorderStyle  = 0
  314.             Caption      = "ListIndex ="
  315.             DragMode     = 0
  316.             Enabled      = -1
  317.             ForeColor    = QBColor(0)
  318.             Height       = Char(1)
  319.             Index        = 0
  320.             Left         = Char(1)
  321.             MousePointer = 0
  322.             TabIndex     = 3
  323.             Tag          = ""
  324.             Top          = Char(0)
  325.             Visible      = -1
  326.             Width        = Char(11)
  327.         END
  328.         BEGIN Label Label4
  329.             Alignment    = 0
  330.             AutoSize     = 0
  331.             BackColor    = QBColor(7)
  332.             BorderStyle  = 0
  333.             Caption      = "(Press ENTER to display!)"
  334.             DragMode     = 0
  335.             Enabled      = -1
  336.             ForeColor    = QBColor(15)
  337.             Height       = Char(1)
  338.             Left         = Char(19)
  339.             MousePointer = 0
  340.             TabIndex     = 5
  341.             Tag          = ""
  342.             Top          = Char(0)
  343.             Visible      = -1
  344.             Width        = Char(25)
  345.         END
  346.         BEGIN Label Label2
  347.             Alignment    = 0
  348.             AutoSize     = 0
  349.             BackColor    = QBColor(7)
  350.             BorderStyle  = 0
  351.             Caption      = "Label2"
  352.             DragMode     = 0
  353.             Enabled      = -1
  354.             ForeColor    = QBColor(0)
  355.             Height       = Char(1)
  356.             Left         = Char(1)
  357.             MousePointer = 0
  358.             TabIndex     = 6
  359.             Tag          = ""
  360.             Top          = Char(1)
  361.             Visible      = -1
  362.             Width        = Char(30)
  363.         END
  364.         BEGIN Label Label3
  365.             Alignment    = 0
  366.             AutoSize     = 0
  367.             BackColor    = QBColor(7)
  368.             BorderStyle  = 0
  369.             Caption      = "Label3"
  370.             DragMode     = 0
  371.             Enabled      = -1
  372.             ForeColor    = QBColor(0)
  373.             Height       = Char(1)
  374.             Left         = Char(1)
  375.             MousePointer = 0
  376.             TabIndex     = 7
  377.             Tag          = ""
  378.             Top          = Char(2)
  379.             Visible      = -1
  380.             Width        = Char(49)
  381.         END
  382.         BEGIN Label Label7
  383.             Alignment    = 0
  384.             AutoSize     = 0
  385.             BackColor    = QBColor(7)
  386.             BorderStyle  = 0
  387.             Caption      = "Label7"
  388.             DragMode     = 0
  389.             Enabled      = -1
  390.             ForeColor    = QBColor(0)
  391.             Height       = Char(1)
  392.             Left         = Char(1)
  393.             MousePointer = 0
  394.             TabIndex     = 16
  395.             Tag          = ""
  396.             Top          = Char(3)
  397.             Visible      = -1
  398.             Width        = Char(49)
  399.         END
  400.         BEGIN Label lblListIndex
  401.             Alignment    = 0
  402.             AutoSize     = 0
  403.             BackColor    = QBColor(7)
  404.             BorderStyle  = 0
  405.             Caption      = "Label1"
  406.             DragMode     = 0
  407.             Enabled      = -1
  408.             ForeColor    = QBColor(0)
  409.             Height       = Char(1)
  410.             Left         = Char(12)
  411.             MousePointer = 0
  412.             TabIndex     = 4
  413.             Tag          = ""
  414.             Top          = Char(0)
  415.             Visible      = -1
  416.             Width        = Char(7)
  417.         END
  418.     END
  419. END
  420. '****************************************************************************
  421. '
  422. '                             CzarList v1.10
  423. '                             October, 1994
  424. '                        Custom Controls for VBDOS
  425. '                   Copyright (c) 1994 by CZAR Software
  426. '                           All Rights Reserved.
  427. '
  428. '                              CZAR Software
  429. '                             P.O. Box 370087
  430. '                          El Paso, TX 79937-0087
  431. '                                   USA
  432. '
  433. '                              FIDO: 1:381/99
  434. '                           Voice: 915-595-8787
  435. '                            BBS: 915-595-8705
  436. '                            Fax: 915-595-8787
  437. '                             CIS: 71031,3614
  438. '                              AOL: czarsoft
  439. '                        InterNet: czarsoft@aol.com
  440. '
  441. ' This is a fully functional shareware version. It is not freeware. It
  442. ' demonstrates the functionality of the custom controls CzList,
  443. ' CzDir, and CzFile. You can test and run the custom controls
  444. ' in the VBDOS programming environment using the included .QLB file. Or,
  445. ' run the DEMO.EXE file. The DEMO.EXE file shows three examples of all
  446. ' custom controls. The shareware version does not include the .LIB object
  447. ' library which is required to produce .EXE files.
  448. '
  449. ' If you would like to compile and create .EXE files with the custom
  450. ' controls, you have to register CzarList. Please use file REGISTER.DOC
  451. ' to register.
  452. '
  453. ' Here is what you get when you register CzList:
  454. '
  455. '    o  The CZLIST.LIB object library to build your own EXE files
  456. '    o  A professionally printed and bound manual
  457. '    o  Most current Version of CZLIST.LIB
  458. '    o  Discounts on other CZAR Software products (see CATALOG.DOC)
  459. '    o  FREE, update notices and bug reports
  460. '    o  FREE, lifetime voice Support at 915-595-8787
  461. '    o  FREE, lifetime fax Support
  462. '    o  FREE, lifetime BBS Support at 915-595-8705
  463. '    o  FREE, lifetime CompuServe Support at 71031,3614
  464. '    o  FREE, lifetime AOL Support at czarsoft
  465. '    o  FREE, lifetime InterNet Support at czarsoft@aol.com
  466. '
  467. '****************************************************************************
  468.  
  469. DEFINT A-Z
  470.  
  471. '$FORM frmDemoDir
  472. '$FORM frmGeneral
  473. '$FORM frmOrder
  474.  
  475. ' CzList Internal functions. These functions have to be declared if you
  476. ' want to use them.
  477. DECLARE FUNCTION CzGetWhatKindMem% ()
  478. DECLARE FUNCTION CzItemsTagged% ()
  479. DECLARE FUNCTION CzAllowTagging% (YesNo%)
  480. DECLARE FUNCTION CzKeybTagScrolling% (YesNo%)
  481. DECLARE FUNCTION CzMouTagScrolling% (YesNo%)
  482. DECLARE FUNCTION CzSetVirtualPath% (PathToSet$)
  483.  
  484. ' Demo functions
  485. DECLARE SUB OpeningScreen ()
  486. DECLARE SUB ShowThreeParts ()
  487. DECLARE SUB AboutCzList ()
  488.  
  489. SUB AboutCzList ()
  490.  
  491.     a$ = "CzList is a general listbox control for VBDOS. You can use it to display and list any kind of information. Each element in the listbox can be up to 75 characters long. It fully supports tagging and untagging."
  492. a$ = a$ + CHR$(13) + CHR$(10)
  493. a$ = a$ + CHR$(13) + CHR$(10) + "CzList will first try to use XMS Memory. If no XMS memory is available, it will try to use EMS Memory. If no XMS and no EMS memory is available, CzList will use the disk as virtual memory."
  494. a$ = a$ + CHR$(13) + CHR$(10)
  495. a$ = a$ + CHR$(13) + CHR$(10) + "Keep a close eye on the amount of conventional memory used during this demo. The amount of conventional memory used will not change no matter how many elements you put into CzList."
  496. MSGBOX a$, 0, "CzList Demo"
  497.  
  498. END SUB
  499.  
  500. SUB chkAllowTag_Click ()
  501.  
  502. IF chkAllowTag.Value = 1 THEN
  503.     Result = CzAllowTagging(0)
  504.     Result = CzKeybTagScrolling(0)
  505.     Result = CzMouTagScrolling(0)
  506.     chkKeybTag.Enabled = -1
  507.     chkMouseTag.Enabled = -1
  508.     chkKeybTag.Value = 1
  509.     chkMouseTag.Value = 1
  510. ELSE
  511.     Result = CzAllowTagging(1)
  512.     Result = CzKeybTagScrolling(1)
  513.     Result = CzMouTagScrolling(1)
  514.     chkKeybTag.Enabled = 0
  515.     chkMouseTag.Enabled = 0
  516. END IF
  517.  
  518. END SUB
  519.  
  520. SUB chkKeybTag_Click ()
  521.  
  522. IF chkKeybTag.Value = 1 THEN
  523.     Result = CzKeybTagScrolling(0)
  524. ELSE
  525.     Result = CzKeybTagScrolling(1)
  526. END IF
  527.  
  528. END SUB
  529.  
  530. SUB chkMouseTag_Click ()
  531.  
  532. IF chkMouseTag.Value = 1 THEN
  533.     Result = CzMouTagScrolling(0)
  534. ELSE
  535.     Result = CzMouTagScrolling(1)
  536. END IF
  537.  
  538. END SUB
  539.  
  540. SUB cmdCancel_Click ()
  541.  
  542. ' You must UNLOAD the form or control(s) before you end your program. CzList
  543. ' will then remove itself from memory. If you do not unload the form or
  544. ' control, the memory used by CzList (either XMS, EMS, or disk space) will
  545. ' not be released and unpredictable results may occur.
  546. UNLOAD frmCzList
  547. frmOrder.SHOW 1
  548. END
  549.  
  550. END SUB
  551.  
  552. SUB cmdCzDir_Click ()
  553.  
  554. ' You must UNLOAD the form or control(s) before you end your program. CzList
  555. ' will then remove itself from memory. If you do not unload the form or
  556. ' control, the memory used by CzList (either XMS, EMS, or disk space) will
  557. ' not be released and unpredictable results may occur.
  558. UNLOAD frmCzList
  559. frmDemoDir.SHOW 1
  560.  
  561. END SUB
  562.  
  563. SUB cmdTag_Click ()
  564.  
  565. ' Tag all elements
  566. ' Value = 1     : tag alll elements in CzList
  567. ' Value = 2     : untag alll elements in CzList
  568. CzList.Value = 1
  569.  
  570. ' Display the number of items tagged.
  571. lblItemsTagged.Caption = STR$(CzItemsTagged)
  572.  
  573. CzList.SETFOCUS
  574.  
  575. END SUB
  576.  
  577. SUB cmdUntag_Click ()
  578.  
  579. ' Untag all elements
  580. ' Value = 1     : tag alll elements in CzList
  581. ' Value = 2     : untag alll elements in CzList
  582. CzList.Value = 2
  583.  
  584. ' Display the number of items tagged.
  585. lblItemsTagged.Caption = STR$(CzItemsTagged)
  586.  
  587. CzList.SETFOCUS
  588.  
  589. END SUB
  590.  
  591. SUB CzList_DblClick ()
  592.  
  593. ' Get the current element and display it.
  594. ' CzList.ListIndex is the current Index. You can also get any other
  595. ' index from 0 to ListCount. For example, to get element 189, use
  596. ' Dummy$ = CzList.List(188). Remember, the list starts with element 0.
  597. MSGBOX CzList.List(CzList.ListIndex), 0, "Mouse Double Click"
  598.  
  599. END SUB
  600.  
  601. SUB CzList_GotFocus ()
  602.  
  603. CzList.BorderStyle = 2
  604.  
  605. END SUB
  606.  
  607. SUB CzList_KeyDown (KeyCode AS INTEGER, Shift AS INTEGER)
  608.  
  609. ' Display the current index.
  610. lblListIndex.Caption = STR$(CzList.ListIndex)
  611.  
  612. ' Display the number of items tagged.
  613. lblItemsTagged.Caption = STR$(CzItemsTagged)
  614.  
  615. ' The ENTER key was pressed. Get the current element and display it.
  616. ' CzList.ListIndex is the current Index. You can also get any other
  617. ' index from 0 to ListCount. For example, to get element 189, use
  618. ' Dummy$ = CzList.List(188). Remember, the list starts with element 0.
  619. IF KeyCode = 13 THEN MSGBOX CzList.List(CzList.ListIndex), 0, "Pressed Enter Key"
  620.  
  621. END SUB
  622.  
  623. SUB CzList_LostFocus ()
  624.  
  625. CzList.BorderStyle = 1
  626.  
  627. END SUB
  628.  
  629. SUB CzList_MouseDown (Button AS INTEGER, Shift AS INTEGER, X AS SINGLE, Y AS SINGLE)
  630.  
  631. ' Display the number of items tagged.
  632. lblItemsTagged.Caption = STR$(CzItemsTagged)
  633.  
  634. END SUB
  635.  
  636. SUB CzList_MouseUp (Button AS INTEGER, Shift AS INTEGER, X AS SINGLE, Y AS SINGLE)
  637.  
  638. ' Display the current index.
  639. lblListIndex.Caption = STR$(CzList.ListIndex)
  640.  
  641. END SUB
  642.  
  643. SUB Form_Load ()
  644.  
  645. OpeningScreen
  646.  
  647. ShowThreeParts
  648.  
  649. AboutCzList
  650.  
  651. ' You can force CzList to use a specific method of storage using the MODE
  652. ' property. Use it only if you really need it. By default, CzList will first
  653. ' try to use XMS memory. If no XMS memory is available, CzList will try to
  654. ' use EMS memory instead. If no EMS memory is available, CzList will then
  655. ' use the disk as virtual memory.
  656. ' If you force CzList to use XMS Memory, CzList will still try to use EMS
  657. ' memory if no XMS memory is available. If no EMS memory is available,
  658. ' CzList will use the disk.
  659. 'CzList.Mode = -1              ' where = -1 (Use XMS Memory)
  660. '                              '       = -2 (Use EMS Memory)
  661. '                              '       = -3 (Use Disk)
  662. ' If you force CzList to use EMS memory, do NOT run your program in the
  663. ' VBDOS environment as it will not work correctly. You have to compile
  664. ' your program into an EXE file.
  665. '
  666. ' NOTE: The MODE property has to be set before you call any other CzList
  667. '       commands and before you load the form or control.
  668.  
  669. ' The Max property tells CzList the maximum number of elements ever to
  670. ' be used. This simply means that during runtime you will never use
  671. ' more than Max of elements in the listbox. The default Max is 1023.
  672. ' You do not need to set the Max property if you are sure that you will
  673. ' never need more than 1024 elements. You can only set the Max property
  674. ' once. You should do this when your program first starts up or set the
  675. ' Max property in the Form Designer. Once the Max property has been set,
  676. ' it MUST not be changed during runtime.
  677. '
  678. ' The default value is 1023. The maximum is 32765. 32765 elements require
  679. ' apx. 2.1 MBytes (XMS, EMS, or disk) whereas 1024 elements require apx.
  680. ' 65 KBytes (XMS, EMS, or disk).
  681.  
  682. Dummy$ = INPUTBOX$("How many elements (Starting with element 0) would you like to put into the ListBox control? Maximum # of elements is 32765 (starting with element 0). It will use either XMS or EMS memory, or diskspace. Enter -1 for no elements." _
  683. , "", "1999")
  684. IF LEN(Dummy$) > 5 THEN
  685.     NumElements& = VAL(LEFT$(Dummy$, 5))
  686. ELSE
  687.     NumElements& = VAL(Dummy$)
  688. END IF
  689. IF NumElements& > 32765 THEN NumElements& = 32765
  690.  
  691. ' Display status window
  692. frmGeneral.Label1.Caption = "One moment...adding" + STR$(NumElements& + 1) + " elements."
  693. frmGeneral.SHOW
  694.  
  695. CzList.Max = NumElements&
  696.  
  697. FOR i = 0 TO NumElements&                    ' Create up to NumElements&
  698.     CzList.ADDITEM STR$(i) + STRING$(74, "*") ' elements and add them into
  699. NEXT                                         ' CzList. NOTE: The maximum
  700.                                                             ' length of each string is 75.
  701.                                                             ' The actual length stored is
  702.                                                             ' 75 plus 1 Tag character
  703.                                                             ' "√" = 76. If the string is
  704.                                                             ' not tagged, a space is used.
  705.                                                             ' Make sure you use a space
  706.                                                             ' (CHR$(32)) as the first
  707.                                                             ' character. Later in your
  708.                                                             ' program, you can check if the
  709.                                                             ' item is tagged or not by
  710.                                                             ' checking the first character
  711.                                                             ' for a CHR$(32) = Not tagged,
  712.                                                             ' or a CHR$(251) = Tagged.
  713.  
  714. CzList.REFRESH
  715.  
  716. 'CzList.Sorted = -1  ' Set the SORTED property to true (-1) if you want the
  717.               ' list to be sorted. CzList will only sort the list
  718.               ' everytime you set the SORTED property. It will not
  719.               ' sort the list when you use the ADDITEM method. The
  720.               ' more elements you have stored in CzList, the longer
  721.               ' it will take to sort CzList. This can take a very
  722.               ' long time if you have up to 32,765 elements. The
  723.               ' internal sorting method is a Shellsort. The Shellsort
  724.               ' is by far the fastet sorting method compared to other
  725.               ' sorting algorithms such as bubble sort, exchange sort,
  726.               ' quick sort, etc. The sorting routine in CzList is
  727.               ' written in optimized VBDOS source code because there
  728.               ' are no sorting algorithms for XMS or EMS data that
  729.               ' can be used with VBDOS custom controls.
  730.               
  731. lblListIndex.Caption = STR$(CzList.ListIndex) ' Display the current index.
  732.  
  733. lblItemsTagged.Caption = STR$(CzItemsTagged)  ' Display the number of items
  734.                             ' tagged.
  735.  
  736. ' Display the number of elements used.
  737. Label2.Caption = "Number of elements =" + STR$(NumElements& + 1)
  738.  
  739. 'Result = CzSetVirtualPath$("I:\TEMP")
  740. ' If CzList uses the disk as virtual memory, you will see a slowdown in
  741. ' performance the more elements you use. For this reason, you can tell
  742. ' CzList where to store the temporary disk file(s) by setting
  743. ' CzSetVirtualPath$ to the path you want to use. It is recommended to
  744. ' use a RAMDRIVE for this purpose. If you do not specify a path for
  745. ' CzSetVirtualPath$, CzList will use the current path.
  746. '
  747. ' Note: You MUST set CzSetVirtualPath$ before you set the Max Property.
  748. '       The best way to do this is to set CzSetVirtualPath$ as the first
  749. '       command in your FORM_LOAD procedure.
  750. '
  751. ' Make sure the drive has enough space left to save the disk file(s). You
  752. ' can calculate the amount of bytes needed using the following formular:
  753. '
  754. ' DiskSpace& = (CzList.Max + 1) * 76
  755. '
  756. ' For example, if you want to use 2000 elements and CzList needs to use
  757. ' the disk, you would have to make sure that there are at least
  758. ' 1,999 + 1 * 76 = 128,000 Bytes available.
  759.  
  760. MemoryUsed& = (NumElements& + 1) * 76
  761. SELECT CASE CzGetWhatKindMem
  762.     CASE -1   ' Use XMS
  763.         d$ = "XMS Memory"
  764.     CASE -2   ' Use EMS
  765.         d$ = "EMS Memory"
  766.         ' EMS requires additional 16 KBytes for memory page slackspace
  767.         MemoryUsed& = ((NumElements& + 1) * 76) + 16384
  768.     CASE ELSE
  769.         d$ = "Disk"
  770. END SELECT
  771.  
  772. ' Show the amount of memory or disk space used.
  773. Label3.Caption = "Used =" + STR$(MemoryUsed&) + " Bytes (" + d$ + ")"
  774.  
  775. ' Show the amount of conventional memory used.
  776. Label7.Caption = "Conventional Memory Free =" + STR$(FRE(-1)) + " Bytes"
  777.  
  778. ' ***** Setup Scrolling and Tagging *****
  779. ' Result = The current status, which is either 0 or 1
  780. ' Result = CzAllowTagging(0)       ' 1 = Disable, 0 = Enable
  781. ' Result = CzKeybTagScrolling(0)   ' 1 = Disable, 0 = Enable
  782. ' Result = CzMouTagScrolling(0)    ' 1 = Disable, 0 = Enable
  783.  
  784. IF CzAllowTagging(0) = 0 THEN
  785.     chkAllowTag.Value = 1
  786.     IF CzKeybTagScrolling(0) = 0 THEN
  787.         chkKeybTag.Value = 1
  788.     ELSE
  789.         chkKeybTag.Value = 2
  790.     END IF
  791.     IF CzMouTagScrolling(0) = 0 THEN
  792.         chkMouseTag.Value = 1
  793.     ELSE
  794.         chkMouseTag.Value = 2
  795.     END IF
  796. END IF
  797.  
  798. ' Unload status window
  799. UNLOAD frmGeneral
  800.  
  801. Left = ((SCREEN.Width - Width) / 2)   ' Center form horizontally
  802. Top = ((SCREEN.Height - Height) / 2)  ' Center form vertically
  803.  
  804. END SUB
  805.  
  806. SUB OpeningScreen ()
  807.  
  808.     a$ = "             CzarList v1.10"
  809. a$ = a$ + CHR$(13) + CHR$(10) + "       Listbox Controls for VBDOS"
  810. a$ = a$ + CHR$(13) + CHR$(10) + "   Copyright (c) 1994 by CZAR Software"
  811. a$ = a$ + CHR$(13) + CHR$(10) + "          All Rights Reserved"
  812. a$ = a$ + CHR$(13) + CHR$(10)
  813. a$ = a$ + CHR$(13) + CHR$(10) + "             CZAR Software"
  814. a$ = a$ + CHR$(13) + CHR$(10) + "            P.O. Box 370087"
  815. a$ = a$ + CHR$(13) + CHR$(10) + "         El Paso, TX 79937-0087"
  816. a$ = a$ + CHR$(13) + CHR$(10) + "                  USA"
  817. a$ = a$ + CHR$(13) + CHR$(10)
  818. a$ = a$ + CHR$(13) + CHR$(10) + "          Voice: 915-595-8787"
  819. a$ = a$ + CHR$(13) + CHR$(10) + "           BBS: 915-595-8705"
  820. a$ = a$ + CHR$(13) + CHR$(10) + "           Fax: 915-595-8787"
  821. a$ = a$ + CHR$(13) + CHR$(10) + "            FIDO: 1:381/99"
  822. a$ = a$ + CHR$(13) + CHR$(10) + "            CIS: 71031,3614"
  823. a$ = a$ + CHR$(13) + CHR$(10) + "             AOL: czarsoft"
  824. a$ = a$ + CHR$(13) + CHR$(10) + "       InterNet: czarsoft@aol.com"
  825. MSGBOX (a$)
  826.  
  827. END SUB
  828.  
  829. SUB ShowThreeParts ()
  830.  
  831.     a$ = "This demo consists of three parts:"
  832. a$ = a$ + CHR$(13) + CHR$(10)
  833. a$ = a$ + CHR$(13) + CHR$(10) + "    ■ A demonstration of CzList (a general listbox)"
  834. a$ = a$ + CHR$(13) + CHR$(10) + "    ■ A demonstration of CzDir (a directory listbox)"
  835. a$ = a$ + CHR$(13) + CHR$(10) + "    ■ A demonstration of CzFile (a file listbox)"
  836. a$ = a$ + CHR$(13) + CHR$(10)
  837. a$ = a$ + CHR$(13) + CHR$(10) + "To see the demonstration for CzList, click the OK button."
  838. MSGBOX (a$)
  839.  
  840. END SUB
  841.  
  842.